package com.dragon.mmochat.model.pkteam;

import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

//战队
public class MmochatPkTeam implements Serializable {
	private static final long serialVersionUID = -2297102581852525609L;
	private int id;
	private String name;
	private int score;
	private Map<Integer, MmochatPkTeamMember> members = new ConcurrentHashMap<Integer, MmochatPkTeamMember>();

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public Map<Integer, MmochatPkTeamMember> getMembers() {
		return members;
	}

	public void setMembers(Map<Integer, MmochatPkTeamMember> members) {
		this.members = new ConcurrentHashMap<Integer, MmochatPkTeamMember>(
				members);
	}

	// TODO:GSON分割线
	public String getGson_Members() {
		if (members == null) {
			return null;
		}
		Gson gson = new Gson();
		return gson.toJson(members,
				new TypeToken<Map<Integer, MmochatPkTeamMember>>() {
				}.getType());
	}

}
